So I've been teaching myself C for a few weeks. Haven't had many problems at all. Just wrote this extremely simple program but it seems to be malfunctioning. It counts correctly the number of uppercase letters in a string so long as i don't use the space-bar. once I add a space it only counts the number of uppercase letters of the first word..
I'm sure its a nublet mistake, help pl0x. printf("I ..........ing love programming");
Code:#include <stdio.h> main() { char text[200]; int i = 0; int uppercase = 0; printf("Enter text:"); scanf("%s", text); while(text[i] != '\0') { if(text[i] > 'A' && text[i] < 'Z') { uppercase++; } i++; } printf("there were %d uppercase letters in that text", uppercase); }